//package cn.iocoder.yudao.module.ai.controller.admin.datasetreleasefile;
//
//import org.springframework.web.bind.annotation.*;
//import javax.annotation.Resource;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.security.access.prepost.PreAuthorize;
//import io.swagger.v3.oas.annotations.tags.Tag;
//import io.swagger.v3.oas.annotations.Parameter;
//import io.swagger.v3.oas.annotations.Operation;
//
//import javax.validation.constraints.*;
//import javax.validation.*;
//import javax.servlet.http.*;
//import java.util.*;
//import java.io.IOException;
//
//import cn.iocoder.yudao.framework.common.pojo.PageParam;
//import cn.iocoder.yudao.framework.common.pojo.PageResult;
//import cn.iocoder.yudao.framework.common.pojo.CommonResult;
//import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
//import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
//
//import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
//
//import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
//import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
//
//import cn.iocoder.yudao.module.ai.controller.admin.datasetreleasefile.vo.*;
//import cn.iocoder.yudao.module.ai.dal.dataobject.datasetreleasefile.DatasetReleaseFileDO;
//import cn.iocoder.yudao.module.ai.service.datasetreleasefile.DatasetReleaseFileService;
//
//@Tag(name = "管理后台 - 数据集解压缩文件列")
//@RestController
//@RequestMapping("/ai/dataset-release-file")
//@Validated
//public class DatasetReleaseFileController {
//
//    @Resource
//    private DatasetReleaseFileService datasetReleaseFileService;
//
//    @PostMapping("/create")
//    @Operation(summary = "创建数据集解压缩文件列")
//    @PreAuthorize("@ss.hasPermission('ai:dataset-release-file:create')")
//    public CommonResult<Long> createDatasetReleaseFile(@Valid @RequestBody DatasetReleaseFileSaveReqVO createReqVO) {
//        return success(datasetReleaseFileService.createDatasetReleaseFile(createReqVO));
//    }
//
//    @PutMapping("/update")
//    @Operation(summary = "更新数据集解压缩文件列")
//    @PreAuthorize("@ss.hasPermission('ai:dataset-release-file:update')")
//    public CommonResult<Boolean> updateDatasetReleaseFile(@Valid @RequestBody DatasetReleaseFileSaveReqVO updateReqVO) {
//        datasetReleaseFileService.updateDatasetReleaseFile(updateReqVO);
//        return success(true);
//    }
//
//    @DeleteMapping("/delete")
//    @Operation(summary = "删除数据集解压缩文件列")
//    @Parameter(name = "id", description = "编号", required = true)
//    @PreAuthorize("@ss.hasPermission('ai:dataset-release-file:delete')")
//    public CommonResult<Boolean> deleteDatasetReleaseFile(@RequestParam("id") Long id) {
//        datasetReleaseFileService.deleteDatasetReleaseFile(id);
//        return success(true);
//    }
//
//    @GetMapping("/get")
//    @Operation(summary = "获得数据集解压缩文件列")
//    @Parameter(name = "id", description = "编号", required = true, example = "1024")
//    @PreAuthorize("@ss.hasPermission('ai:dataset-release-file:query')")
//    public CommonResult<DatasetReleaseFileRespVO> getDatasetReleaseFile(@RequestParam("id") Long id) {
//        DatasetReleaseFileDO datasetReleaseFile = datasetReleaseFileService.getDatasetReleaseFile(id);
//        return success(BeanUtils.toBean(datasetReleaseFile, DatasetReleaseFileRespVO.class));
//    }
//
//    @GetMapping("/page")
//    @Operation(summary = "获得数据集解压缩文件列分页")
//    @PreAuthorize("@ss.hasPermission('ai:dataset-release-file:query')")
//    public CommonResult<PageResult<DatasetReleaseFileRespVO>> getDatasetReleaseFilePage(@Valid DatasetReleaseFilePageReqVO pageReqVO) {
//        PageResult<DatasetReleaseFileDO> pageResult = datasetReleaseFileService.getDatasetReleaseFilePage(pageReqVO);
//        return success(BeanUtils.toBean(pageResult, DatasetReleaseFileRespVO.class));
//    }
//
//    @GetMapping("/export-excel")
//    @Operation(summary = "导出数据集解压缩文件列 Excel")
//    @PreAuthorize("@ss.hasPermission('ai:dataset-release-file:export')")
//    @ApiAccessLog(operateType = EXPORT)
//    public void exportDatasetReleaseFileExcel(@Valid DatasetReleaseFilePageReqVO pageReqVO,
//              HttpServletResponse response) throws IOException {
//        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
//        List<DatasetReleaseFileDO> list = datasetReleaseFileService.getDatasetReleaseFilePage(pageReqVO).getList();
//        // 导出 Excel
//        ExcelUtils.write(response, "数据集解压缩文件列.xls", "数据", DatasetReleaseFileRespVO.class,
//                        BeanUtils.toBean(list, DatasetReleaseFileRespVO.class));
//    }
//
//}